From 93eb6f30d7ed3ef30cb2a540e7002ed18f62bd8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 8 May 2006 18:17:55 +0000 Subject: [PATCH] * Added many missing formatNum calls --- RELEASE-NOTES | 1 + includes/SpecialCategories.php | 3 ++- includes/SpecialMIMEsearch.php | 3 ++- includes/SpecialMostimages.php | 4 ++-- includes/SpecialMostlinked.php | 4 +++- includes/SpecialMostlinkedcategories.php | 4 ++-- includes/SpecialMostrevisions.php | 4 ++-- includes/SpecialRecentchanges.php | 21 +++++++++------------ includes/SpecialWantedcategories.php | 4 ++-- includes/SpecialWantedpages.php | 9 +++++---- 10 files changed, 30 insertions(+), 27 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cef3225c0f..69357634dd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -226,6 +226,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 5858) Update for Russian language (ru) * (bug 5860) Update for Indonesian language (id) * (bug 1120) Update for Czech language (Cs) +* Added many missing formatNum calls == Compatibility == diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 6ac593a56b..e5ff2b3464 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -50,9 +50,10 @@ class CategoriesPage extends QueryPage { } function formatResult( $skin, $result ) { + global $wgLang; $title = Title::makeTitle( NS_CATEGORY, $result->title ); $plink = $skin->makeLinkObj( $title, $title->getText() ); - $nlinks = wfMsg( 'members', $result->count ); + $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->count ) ); return wfSpecialList($plink, $nlinks); } } diff --git a/includes/SpecialMIMEsearch.php b/includes/SpecialMIMEsearch.php index 6789b6101e..f38d055891 100644 --- a/includes/SpecialMIMEsearch.php +++ b/includes/SpecialMIMEsearch.php @@ -72,7 +72,8 @@ class MIMEsearchPage extends QueryPage { $download = $skin->makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) ); $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), $wgLang->formatNum( $result->img_size ) ); - $dimensions = wfMsg( 'widthheight', $result->img_width, $result->img_height ); + $dimensions = wfMsg( 'widthheight', $wgLang->formatNum( $result->img_width ), + $wgLang->formatNum( $result->img_height ) ); $user = $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text ); $time = $wgLang->timeanddate( $result->img_timestamp ); diff --git a/includes/SpecialMostimages.php b/includes/SpecialMostimages.php index a10e5a1fc3..d881e9bd3a 100644 --- a/includes/SpecialMostimages.php +++ b/includes/SpecialMostimages.php @@ -38,14 +38,14 @@ class MostimagesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; $nt = Title::makeTitle( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getPrefixedText() ); $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); - $nl = wfMsg( 'nlinks', $result->value ); + $nl = wfMsg( 'nlinks', $wgLang->formatNum ( $result->value ) ); $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl ); return wfSpecialList($plink, $nlink); diff --git a/includes/SpecialMostlinked.php b/includes/SpecialMostlinked.php index 9f26a34dbd..aa86a4c014 100644 --- a/includes/SpecialMostlinked.php +++ b/includes/SpecialMostlinked.php @@ -77,9 +77,11 @@ class MostlinkedPage extends QueryPage { * @return string */ function formatResult( $skin, $result ) { + global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); $link = $skin->makeLinkObj( $title ); - $wlh = $this->makeWlhLink( $title, wfMsgHtml( 'nlinks', $result->value ), $skin ); + $wlh = $this->makeWlhLink( $title, wfMsgHtml( 'nlinks', + $wgLang->formatNum( $result->value ) ), $skin ); return wfSpecialList( $link, $wlh ); } } diff --git a/includes/SpecialMostlinkedcategories.php b/includes/SpecialMostlinkedcategories.php index 35ee07ff6f..53acbe71c3 100644 --- a/includes/SpecialMostlinkedcategories.php +++ b/includes/SpecialMostlinkedcategories.php @@ -57,14 +57,14 @@ class MostlinkedCategoriesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; $nt = Title::makeTitle( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getText() ); $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ); - $nlinks = wfMsg( 'members', $result->value ); + $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->value ) ); return wfSpecialList($plink, $nlinks); } } diff --git a/includes/SpecialMostrevisions.php b/includes/SpecialMostrevisions.php index c8a04a546f..9bef93c411 100644 --- a/includes/SpecialMostrevisions.php +++ b/includes/SpecialMostrevisions.php @@ -42,14 +42,14 @@ class MostrevisionsPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; $nt = Title::makeTitle( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getPrefixedText() ); $plink = $skin->makeKnownLinkObj( $nt, $text ); - $nl = wfMsg( 'nrevisions', $result->value ); + $nl = wfMsg( 'nrevisions', $wgLang->formatNum( $result->value ) ); $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ); return wfSpecialList($plink, $nlink); diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index a3332e8f8f..5b72cc0f6d 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -502,24 +502,21 @@ function rcOptionsPanel( $defaults, $nondefaults ) { $note = wfMsg( 'rcnote', $wgLang->formatNum( $options['limit'] ), $wgLang->formatNum( $options['days'] ), $wgLang->timeAndDate( wfTimestampNow(), true ) ); // limit links - $cl = ''; $options_limit = array(50, 100, 250, 500); - $i = 0; - while ( $i+1 < count($options_limit) ) { - $cl .= makeOptionsLink( $options_limit[$i], array( 'limit' => $options_limit[$i] ), $nondefaults) . ' | ' ; - $i++; + foreach( $options_limit as $value ) { + $cl[] = makeOptionsLink( $wgLang->formatNum( $value ), + array( 'limit' => $value ), $nondefaults) ; } - $cl .= makeOptionsLink( $options_limit[$i], array( 'limit' => $options_limit[$i] ), $nondefaults) ; + $cl = implode( ' | ', $cl); // day links, reset 'from' to none - $dl = ''; $options_days = array(1, 3, 7, 14, 30); - $i = 0; - while ( $i+1 < count($options_days) ) { - $dl .= makeOptionsLink( $options_days[$i], array( 'days' => $options_days[$i], 'from' => '' ), $nondefaults) . ' | ' ; - $i++; + foreach( $options_days as $value ) { + $dl[] = makeOptionsLink( $wgLang->formatNum( $value ), + array( 'days' => $value, 'from' => '' ), $nondefaults) ; } - $dl .= makeOptionsLink( $options_days[$i], array( 'days' => $options_days[$i], 'from' => '' ), $nondefaults) ; + $dl = implode( ' | ', $dl); + // show/hide links $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' )); diff --git a/includes/SpecialWantedcategories.php b/includes/SpecialWantedcategories.php index d890d0f081..a1b6d05d3d 100644 --- a/includes/SpecialWantedcategories.php +++ b/includes/SpecialWantedcategories.php @@ -59,7 +59,7 @@ class WantedCategoriesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang, $wgContLang; $nt = Title::makeTitle( $result->namespace, $result->title ); $text = $wgContLang->convert( $nt->getText() ); @@ -68,7 +68,7 @@ class WantedCategoriesPage extends QueryPage { $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) : $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) ); - $nlinks = wfMsg( 'members', $result->value ); + $nlinks = wfMsg( 'members', $wgLang->formatNum( $result->value ) ); return wfSpecialList($plink, $nlinks); } } diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 100c6c0f92..92958e8d1c 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -71,7 +71,7 @@ class WantedPagesPage extends QueryPage { function formatResult( $skin, $result ) { - global $wgContLang; + global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); @@ -91,8 +91,9 @@ class WantedPagesPage extends QueryPage { # Make a link to "what links here" if it's required $wlhLink = $this->nlinks - ? $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks', $result->value ) ) - : ""; + ? $this->makeWlhLink( $title, $skin, wfMsgHtml( 'nlinks', + $wgLang->formatNum( $result->value ) ) ) + : null; return wfSpecialList($pageLink, $wlhLink); } @@ -106,7 +107,7 @@ class WantedPagesPage extends QueryPage { */ function makeWlhLink( &$title, &$skin, $text ) { $wlhTitle = Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' ); - return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() ); + return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() ); } } -- 2.20.1